from flask_wtf import FlaskForm
from wtforms import StringField, SelectField, PasswordField
from wtforms.validators import DataRequired, EqualTo

''' 登录表单 '''
class LoginForm(FlaskForm):
    username = StringField(validators=[DataRequired('请输入用户名')])
    password = StringField(validators=[DataRequired('请输入密码')])
    # verify_code = StringField(validators=[DataRequired('请输入验证码')])

class AddAdminForm(FlaskForm):
    role_id = StringField(validators=[DataRequired('请选择角色')])
    username = StringField(validators=[DataRequired('请输入用户名')])
    password = PasswordField(validators=[DataRequired('请输入密码')])
    rpassword = PasswordField(validators=[DataRequired('请输入密码'), EqualTo('password', '两次输入密码不一致')])

class AddMenuForm(FlaskForm):
    name = StringField(validators=[DataRequired('请输入菜单名称')])
    
class AddRoleForm(FlaskForm):
    name = StringField(validators=[DataRequired('请输入角色名称')])